#pragma once

class WTerrain: public IWorldMod, public ISingleton<WTerrain>
{
public:
	WTerrain();
	virtual ~WTerrain();

	/*-IWorldMod----------------------------------------------------------------*/
	void OnLevelLoad(const std::string& level);
	void OnLevelUnload();
	void OnLevelCalc();

	/*--------------------------------------------------------------------------*/

	void GetHeight(glm::vec3& v) const;
	float GetJunglePropability(const glm::vec3& v) const;
	float GetRadiationLevel(const glm::vec3& v) const;

	void GetNormal(const glm::vec3& v, glm::vec3& normal) const;

	const Texture* GetHeightMap() const;

	Quad* GetQuad(const glm::vec3& pos) const;
	bool IsCollision(const glm::vec3& pos) const;

private:
	SDLTexture* m_heightmap;
	SDLTexture* m_detailmap;

	Quad** m_quads;
	Texture* m_heightmapOGL;
};

